const KoaRouter = require("@koa/router");
const UserController = require("../controller/user.controller.js");
const verifyUser = require("../middleware/verifyUser.js");
const verifyLogin = require("../middleware/verifyLogin.js");
const verifyToken = require("../middleware/verifyToken.js");

const userRouter = new KoaRouter({ prefix: "/users" });

userRouter.post("/create", verifyToken, verifyUser, UserController.create);
userRouter.post("/delete", verifyToken, UserController.delete);
userRouter.post("/page", verifyToken, UserController.page);
userRouter.post("/update", verifyToken, UserController.update);
userRouter.post("/resetpassword", verifyToken, UserController.resetpassword);
userRouter.post("/login", verifyLogin, UserController.login);
userRouter.get("/userinfo", verifyToken, UserController.userinfo);

module.exports = userRouter;
